home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / wordproc / wf_v31c.arj / DOCS / WF.011 < prev    next >
Text File  |  1992-01-31  |  7KB  |  197 lines

  1. .f3                              - # -              Chapter 11 - Calculator
  2. .rm70
  3. .tc
  4. .tc1
  5. .tc 11. CALCULATOR ........................................#
  6. CHAPTER 11   CALCULATOR
  7.  
  8. .imCalculator (Alt =)
  9.  
  10. Word Fugue has a built in calculator that you can use while you are
  11. editing. All the usual mathematical operations are available -
  12. addition, subtraction, division, multiplication, and exponentiation.
  13. Additional functions are natural and common logarithms, square root,
  14. factorial, and the trigonometric functions sine, cosine, tangent and
  15. arctangent.
  16.  
  17. Several symbols (operators) are used in Word Fugue's Mathematical
  18. equations.
  19.  
  20. .ix   Operators in equations
  21.     Operator            Function
  22.      +                  addition
  23.      -                  subtraction
  24.      ^                  exponentiation (raising a number to a power)
  25.      *                  multiplication
  26.      /                  division
  27.      div                integer division
  28.      mod                integer division giving remainder only
  29.      shl                shift the bit pattern (4 byte integer) left
  30.                         same as multiplying by 2:
  31.                         4 shl 2 = 16      same as 4 * 2 * 2
  32.      shr                shift the bit pattern (4 byte integer) right
  33.                         same as dividing by 2:
  34.                         16 shr 2 = 4      same as 16 / 2 / 2
  35.      and                merge 2 bit patterns:
  36.                            1 and 1 => 1
  37.                            1 and 0 => 0
  38.                            0 and 1 => 0
  39.                            0 and 0 => 0
  40.      or                 merge 2 bit patterns:
  41.                            1 or 1 => 1
  42.                            1 or 0 => 1
  43.                            0 or 1 => 1
  44.                            0 or 0 => 0
  45.      xor                merge 2 bit patterns:
  46.                            1 xor 1 => 0
  47.                            1 xor 0 => 1
  48.                            0 xor 1 => 1
  49.                            0 xor 0 => 0
  50.  
  51. .ix   Functions
  52.     SQRT()              square root
  53.     SQR()               square
  54.     SIN()               sine
  55.     COS()               cosine
  56.     TAN()               tangent
  57.     ATN()               arctangent
  58.     LN()                natural log
  59.     LOG()               log base 10
  60.     FACT()              factorial
  61.     EXP()               e raised to the power x
  62.     PI                  the value of PI
  63.     TRUE                the value 1 or boolean true
  64.     FALSE               the value 0 or boolean false
  65.  
  66. .CP5
  67. The circle functions (SIN COS TAN ATN) all work in radians, not
  68. degrees, so that SIN(PI) = 0, but SIN(90) = 0.893996663600558
  69.  
  70. You can use these operators in any order in any combination for almost
  71. any calculation. Equations are limited in length to the width of the
  72. screen. Each function can have an arbitrarily complicated equation
  73. within its brackets.
  74.  
  75. For example
  76.  
  77.       SQRT(SQR(34.5))
  78.       LOG(FACT(5)+SIN(21)*LN(1.02345296368))
  79.  
  80. .ix   Scientific notation
  81. You can use scientific notation to enter a long number. For example
  82. 1.23e15 represents the number 1230000000000000.000. Answers have a
  83. maximum precision of 19 digits. If the answer is longer, Word Fugue
  84. will give the closest answer it can, using 20 digits. The largest
  85. number you can work with is 1.1E+4932, and the smallest is 3.4E-4932.
  86. Overflow will cause erroneous results to display. (Word Fugue uses 20
  87. digit reals internally)
  88.  
  89. .ix   Order of Precedence
  90. Where there is more than one operator on a line, Word Fugue performs
  91. the operations in a specific order - exponentiation, then
  92. multiplication, division, then addition and subtraction. When
  93. operators are of equal precedence, Word Fugue performs the operations
  94. from left to right.
  95.  
  96. .CP5
  97. .ix   Parentheses
  98. You can change the order in which Word Fugue performs operations by
  99. using parentheses to enclose operations that are to be done first. You
  100. can enclose parentheses within parentheses for more complicated
  101. calculations. Word Fugue always performs the operations within the
  102. innermost set of parentheses first.
  103.  
  104. For example:
  105.   2^3+4-5/6*7           (answer     6.16666667)
  106.   2^(3+4-5)/6*7         (answer     4.66666667)
  107.   2^((3+4-5)/6*7)       (answer     5.03968420)
  108.  
  109. .ix   Boolean equations
  110. You can also enter boolean equations for evaluation, using the
  111. functions TRUE and FALSE. The boolean operators supported are
  112.  
  113.         AND
  114.         OR
  115.         XOR
  116.         NOT
  117.  
  118. and you can put boolean equations in brackets. The result will be 1
  119. for True and 0 for False. If you use other numbers, their binary bit
  120. pattern will be combined according to the rules of boolean algebra.
  121.  
  122. .CP11
  123. For example
  124.    true xor false               (answer 1.0 boolean)
  125.    1 xor 3                      (answer 2.0 numeric)
  126.                                  1 = 01 binary
  127.                                  3 = 11 binary
  128.                                  X = 10 binary => 2 numeric
  129.    10 / 3                       (answer 3.333333333333333)
  130.    10 div 3                     (answer 3 (integer quotient))
  131.    10 mod 3                     (answer 1 (the remainder) )
  132.    5 shl 1                      (answer 10)
  133.    5 shr 1                      (answer 2)
  134.  
  135. NOTE - When you use operators that are letters, you must separate them
  136.        from the values they operate on by spaces. Thus
  137.  
  138.            10 mod 3 is right but 10mod3 is wrong.
  139.  
  140. .cp8
  141. .tc    Using The Pop Up Calculator ........................#
  142. Using The Pop Up Calculator
  143.  
  144. 1. Press Alt = or Ctrl J M to display the calculator window.
  145.    Refer to Fig 11.1 below.
  146. 2. Type an equation.
  147. 3. Press Enter
  148.    You will see the result appear in the next line
  149. 4. Press ESC to return to editing, or press Enter to type in a new
  150.    equation. If you press an editing key first, you can edit the
  151.    existing equation.
  152.  
  153.  
  154.      ╔══════════════════ Calculator: Enter Formula to calculate: ════════════╗
  155.      ║ 16 shr 2                                                              ║
  156.      ║                                                                       ║
  157.      ║                                                                       ║
  158.      ║ ABS,SQRT,SQR,SIN,COS,ATN,LN,LOG,EXP,TAN,FACT,^,*,/,+,-                ║
  159.      ║                                                                       ║
  160.      ╚═══════════════════════════════════════════════════════════════════════╝
  161.  
  162.  
  163.                         Fig 11.1 - Pop Up Calculator
  164. .tc1 Fig 11.1 - Pop Up Calculator ..........................#
  165.  
  166.  
  167. .tc    Copying the Last Result Into the Document ..........#
  168. .ix   Pasting last result
  169. Copying the Last Result Into the Document
  170.  
  171. To copy the last result into the document you are editing press 
  172.  
  173.         Alt O =
  174.      or Ctrl J I =
  175.      or Alt M A     (macro)
  176.  
  177. The result will appear where the cursor is positioned.
  178.  
  179. Note the next time you use the calculator in the same editing session,
  180. you will find the last equation displayed ready for you to re-enter or
  181. edit.
  182.  
  183. .CP5
  184. .tc    Copying the Equation into the Document .............#
  185. .ix   Pasting equation
  186. Copying the Equation into the Document
  187.  
  188. To copy the actual equation used into the document you are editing,
  189. type in
  190.  
  191.         Alt O #
  192.      or Ctrl J I #
  193.      or Alt M E   (macro)
  194.  
  195. The equation will appear at the cursor position.
  196.  
  197.